<style>
    .profile-avatar-container {
        position: relative;
        width: 100px;
        margin: 0 auto;
    }

    .profile-avatar-container .profile-user-img {
        width: 100px;
        height: 100px;
    }

    .profile-avatar-container .profile-avatar-text {
        display: none;
    }

    .profile-avatar-container:hover .profile-avatar-text {
        display: block;
        position: absolute;
        height: 100px;
        width: 100px;
        background: #444;
        opacity: .6;
        color: #fff;
        top: 0;
        left: 0;
        line-height: 100px;
        text-align: center;
    }

    .profile-avatar-container button {
        position: absolute;
        top: 0;
        left: 0;
        width: 100px;
        height: 100px;
        opacity: 0;
    }
</style>

<form id="update-form" class="form-horizontal"  role="form" data-toggle="validator" method="POST" action="{:url('general.profile/update')}">
    {:token()}
    <input type="hidden" id="c-avatar" name="row[avatar]" value="{$r.avatar|htmlentities}"/>
    <div class="form-group">
        <label class="control-label col-xs-6 col-sm-2">头像:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="profile-avatar-container">
                <img class="profile-user-img img-responsive img-circle" onerror="this.src='/assets/img/avatarbak.png'" src="{$r.avatar|cdnurl|htmlentities}" alt="">
                <div class="profile-avatar-text img-circle">{:__('Click to edit')}</div>
                <button type="button" id="faupload-avatar" class="faupload" data-input-id="c-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="username" name="row[username]" value="{$r.username|htmlentities}" disabled/>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="email" name="row[email]" value="{$r.email|htmlentities}" data-rule="required;email"/>
        </div>
    </div>
    <div class="form-group">
        <label for="nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="nickname" name="row[nickname]" value="{$r.nickname|htmlentities}" data-rule="required"/>
        </div>
    </div>

    <div class="form-group">
        <label for="password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="password" class="form-control" id="password" placeholder="{:__('Leave password blank if dont want to change')}" autocomplete="new-password" name="row[password]" value="" data-rule="password"/>
        </div>
    </div>

    <div class="form-group">
        <label for="re_password" class="control-label col-xs-12 col-sm-2">确认密码:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="password" class="form-control" id="re_password" placeholder="再次输入密码" autocomplete="new-password" name="row[re_password]" value="" data-rule="确认密码: match(row[password])"/>
        </div>
    </div>

    <div class="form-group">
        <label for="nickname" class="control-label col-xs-12 col-sm-2">个人介绍:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="intro" class="form-control " rows="5" name="row[intro]" cols="50">{$r.intro|htmlentities}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label for="nickname" class="control-label col-xs-12 col-sm-2">分类:</label>
        <div class="col-xs-12 col-sm-8" style="padding-top: 6px;">
            {volist name="$r.catArr" id="vo"  }
                {$vo}
            {/volist}
        </div>
    </div>

    <div class="form-group">
        <label for="nickname" class="control-label col-xs-12 col-sm-2">标签:</label>
        <div class="col-xs-12 col-sm-8" style="padding-top: 6px;">
            {volist name="$r.tagsArr" id="vo"  }
                {$vo}
            {/volist}
        </div>
    </div>




    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>